package com.bingxue.edu.management.education.model.resp;

import com.bingxue.edu.management.education.model.entity.Lesson;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import static com.bingxue.edu.common.constant.DateConstants.FORMATTER_TIME_HHmm;

@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "教室课表信息返回")
public class ClassroomScheduleInfoResp extends Lesson {

    @Schema(description = "班级名称")
    private String className;

    @Schema(description = "教室名称")
    private String classroomName;

    @Schema(description = "校区名称")
    private String campusName;

    @Schema(description = "主讲老师名称")
    private String leadTeacherName;

    @Schema(description = "时分区间")
    private String between;

    @Schema(description = "开始时分")
    private String start;

    @Schema(description = "结束时分")
    private String end;

    @Schema(description = "校区-教室名称")
    private String classroomAndCampusName;


    @Schema(description = "时分区间")
    public String getBetween() {
        String startTime = getStartTime().format(FORMATTER_TIME_HHmm);
        String endTime = getEndTime().format(FORMATTER_TIME_HHmm);
        return startTime +"-"+ endTime;
    }
    @Schema(description = "开始时分")
    public String getStart() {
        return getStartTime().format(FORMATTER_TIME_HHmm);
    }
    @Schema(description = "结束时分")
    public String getEnd() {
        return getEndTime().format(FORMATTER_TIME_HHmm);
    }

    @Schema(description = "结束时分")
    public String getClassroomAndCampusName() {
        return campusName+"-"+classroomName;
    }

}
